"""
WSGI config for platform_auth project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application
from feign_client.eureka_init import eureka_init

from platform_auth.settings import IS_EUREKA, EUREKA_CLIENT_PORT, EUREKA_CLIENT_APP_NAME, EUREKA_SERVER

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'platform_auth.settings')

if IS_EUREKA:
    eureka_init(eureka_server = EUREKA_SERVER, app_name = EUREKA_CLIENT_APP_NAME, port = EUREKA_CLIENT_PORT)

application = get_wsgi_application()
